#include<stdio.h>
#include<string.h>

int main()
{
	int i=0;
	char x[50][50];
	while (gets(x[i])!=NULL)
	{
		if (strcmp(x[i],"exit")==0)
		{
			printf("End Of Input\n");
			break;
		}
		int len,j,a=0,b=0,c=0,d=0;
		len=strlen(x[i]);
		for (j=0;j<len;j++)
		{
			if (x[i][j]>=48&&x[i][j]<=57)
				a++;
			else if (x[i][j]>=65&&x[i][j]<=90)
				b++;
			else if (x[i][j]>=97&&x[i][j]<=122)
				c++;
			else
				d++;
		}
		printf("%d,%d,%d,%d,\n",a,b,c,d);
		i++;
	}
	return 0;
}
